len() returns the length of a string.
def strlen2(s, t):
length = len(s) + len(t)
return length
| Function Call | Return Value | |||
|---|---|---|---|---|
| strlen2('Bike', 'grass') | → | |||
| strlen2('', '') | → | |||
| strlen2('56', '') | → | |||
| strlen2('Cat', 'Dog') | → | |||
| strlen2('Golf', 'Ball') | → | |||
Experiment with this code on Gitpod.io